{% extends 'TopxiaWebBundle::bootstrap-modal-layout.html.twig' %}

{% block title %}{{'登录'|trans}}{{ setting('site.name') }}{% endblock %}
{% set modal_class = 'login-modal' %}
{% block body %}

<form id="login-ajax-form" class="form-vertical form-vertical-small" method="post" action="{{ path('login_check') }}">

  <div class="alert alert-danger" style="display:none;"></div>

  <div class="form-group mbl">
    <label class="control-label hidden" for="ajax-username">{{'邮箱/手机/用户名'|trans}}</label>
    <div class="controls">
      <input class="form-control input-lg" type="text" id="ajax-username" name="_username" placeholder="{{'邮箱/手机/用户名'|trans}}" />
    </div>
  </div>

  <div class="form-group mbl">
    <label class="control-label hidden" for="ajax-password">{{'密码'|trans}}</label>
    <div class="controls">
      <input class="form-control input-lg" type="password" id="ajax-password" name="_password" placeholder="{{'密码'|trans}}" />
    </div>
  </div>

  <div class="form-group mbl text-muted">
    <input type="checkbox" name="_remember_me" checked="checked"> {{'记住密码'|trans}}
  </div>

  <div class="form-group">
    <button type="submit" class="btn btn-primary btn-lg btn-block">{{'登录'|trans}}</button>
  </div>

  <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
</form>
<script>
	app.load('auth/login-ajax');
</script>

{% endblock %}

{% block footer %}
<div class="text-left text-sm">
  <a href="{{ path('password_reset') }}">{{'找回密码'|trans}}</a>
  <span class="text-muted mhs">|</span>
  <span class="text-muted">{{'还没有注册帐号？'|trans}}</span>
  <a href="{{ path('register', {goto:_target_path}) }}">{{'立即注册'|trans}}</a>
</div>

{% if setting('login_bind.enabled') %}
  <div class="social-login">
    <span>
      {{ render(controller('TopxiaWebBundle:Login:oauth2LoginsBlock', {targetPath:_target_path})) }}
    </span>
    <div class="line"></div>
  </div>
{% endif %}


{% endblock %}